package com.wmd.core.exceptions;
/**
 * @Description: TODO
 * @Author hy
 * @Date 2020-07-17 9:55
 * @Version 1.0
 */

import lombok.Getter;
import lombok.Setter;


/**
 * spring 对于 RuntimeException 异常才会进行事务回滚。
 * @author zhaojq
 * @since 2020/12/9
 */
@Getter
@Setter
public class MyException extends RuntimeException {

    //public MyException(Integer code, Exception exception) {
        //this.code = code;
        //this.exception = exception;
    //}
    public MyException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public MyException(Integer code,String message, String exception) {
        this.code = code;
        this.exception = exception;
        this.message=message;
    }

	private Integer code;
   // private Exception exception;
    private String exception;
    private String message;

    public static MyException create(Integer code,String message, String exception){
        return new MyException(code,message,exception);
    }
}